<?php

namespace ticket\modules\frontend\models;

use Yii;

/**
 * This is the model class for table "tk_common_app".
 *
 * @property int $app_id
 * @property string $app_name
 * @property string $appid
 * @property string $appsecret
 * @property string $comid
 * @property int $state
 * @property int $app_info_id
 * @property string $close_reason
 * @property string $expire_time
 * @property string $add_time
 */
class CommonApp extends \yii\db\ActiveRecord
{
    /**
     * {@inheritdoc}
     */
    public static function tableName()
    {
        return 'tk_common_app';
    }

    /**
     * {@inheritdoc}
     */
    public function rules()
    {
        return [
            [['appid', 'appsecret', 'comid', 'close_reason'], 'required'],
            [['state', 'app_info_id'], 'integer'],
            [['close_reason'], 'string'],
            [['expire_time', 'add_time'], 'safe'],
            [['app_name'], 'string', 'max' => 64],
            [['appid'], 'string', 'max' => 18],
            [['appsecret'], 'string', 'max' => 32],
            [['comid'], 'string', 'max' => 8],
        ];
    }

    /**
     * {@inheritdoc}
     */
    public function attributeLabels()
    {
        return [
            'app_id' => 'App ID',
            'app_name' => 'App Name',
            'appid' => 'Appid',
            'appsecret' => 'Appsecret',
            'comid' => 'Comid',
            'state' => 'State',
            'app_info_id' => 'App Info ID',
            'close_reason' => 'Close Reason',
            'expire_time' => 'Expire Time',
            'add_time' => 'Add Time',
        ];
    }
}
